//
//  ViewController.m
//  BDASR
//
//  Created by jnl on 2018/2/24.
//  Copyright © 2018年 newenergy. All rights reserved.
//

#import "ViewController.h"
#import "BDSpeechManager.h"

@interface ViewController ()
@property (nonatomic,copy)NSString *switchTitle;
@property (weak, nonatomic) IBOutlet UILabel *switchLabel;
@property (nonatomic,strong)BDSpeechManager *bdSpeechManager;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

}

-(BDSpeechManager *)bdSpeechManager{
    if (!_bdSpeechManager) {
        _bdSpeechManager=[BDSpeechManager shareManager];
    }
    return _bdSpeechManager;
}

- (IBAction)clickOnSpeech:(id)sender {
  
    [self.bdSpeechManager startRecognition];
    self.switchTitle=@"ON";
    
    
}

- (IBAction)clickOffSpeech:(id)sender {
    [self.bdSpeechManager cancelRecognition];
     self.switchTitle=@"OFF";
}

-(void)setSwitchTitle:(NSString *)switchTitle
{
    self.switchLabel.text=switchTitle;
}

@end
